#include <BustaNetClient.h>
Public Member Functions | |
BustaNetClient () | |
Constructor. | |
~BustaNetClient () | |
Destructor. | |
char * | init () |
Initializes the client and prepares it for connection. | |
char * | connect (char *IP, Uint16 serverPort) |
Connects to a server using a given port. | |
void | disconnect () |
Disconnects from the server. | |
BustaModelMPGameState * | getMPGS () |
Returns game state information about opponent players. | |
BustaNetMsgQ * | getPriorityQ () |
Returns the server priority message queue. | |
BustaNetMsgQ * | getSandwichQ () |
Returns the special sandwich queue. | |
char * | getServerName () |
Returns the name of the server connected to. | |
MPConnectResponse * | joinGame (char *playerName) |
Joins the server multiplayer game. | |
void | processNet () |
Handles all incoming network data. | |
void | sendCharSelect (BustaModelCharacter character) |
Sends character selection of player. | |
void | sendCursor (BustaModelPosition *cursor) |
Sends current character selection cursor position of player. | |
void | sendGameOver () |
Notifies the server that the player has lost the game. | |
void | sendOpponentViewReq (int opponentID) |
Tells the server which opponent the player wishes to view. | |
void | sendReady () |
Sends a ready message to the server. | |
void | sendSandwich (int opponentID, SpecialSandwich sandwich) |
Sends a spcial sandwich across the network. | |
void | sendState (BustaModelGameState *gs) |
Sends player's game state to the server. |
Busta'Sandwich Client for networked multiplayer games.
|
Constructor. Initializes variables |
|
Destructor. Close any open connections and shutdown SDLNet |
|
Connects to a server using a given port. The client initializes a TCP connection with the server on the specified port.
|
|
Disconnects from the server. The connection between the server and client is disconnected. Subsequent connections may be made using the client |
|
Returns game state information about opponent players. Returns a pointer to a BustaModelMPGameState containing information about opponent players.
|
|
Returns the server priority message queue. Returns the queue of messages from the server. These messages do not cover special sandwiches or game states.
|
|
Returns the special sandwich queue. Returns the queue of special sandwiches sent between players in a multiplayer game.
|
|
Returns the name of the server connected to. Returns the name of the server the client is currently connected to.
|
|
Initializes the client and prepares it for connection. Initializes SDLNet. Relays any error message back.
|
|
Joins the server multiplayer game. This method attempts to connect the client to the multiplayer game hosted by the server. The client should be connected to the server before running this method.
|
|
Handles all incoming network data. Processes all data currently queued on the TCP socket. The data is partitioned out into three message containers. Each of these three message containers is accessible through an accompanying accessor method.
|
|
Sends character selection of player. Sends the character selection by the player to the server to be sent to all connected players.
|
|
Sends current character selection cursor position of player. Sends the current position of the player's cursor during multiplayer character selection.
|
|
Notifies the server that the player has lost the game. A message is sent to the server to notify it that the player has lost in the current multiplayer game. |
|
Tells the server which opponent the player wishes to view. A message is sent to the server to tell it which opponent the player wishes to have a detailed view of. The detailed view contains information to display the entire screen of the opponent rather than limited brief data.
|
|
Sends a ready message to the server. Sending a ready message to the server indicates that the client is ready to begin the multiplayer game. The ready state is visible to all other clients and is used to determine when the server should transition from the accepting connections state. |
|
Sends a spcial sandwich across the network. A special sandwich is sent from the player to an opposing player.
|
|
Sends player's game state to the server. A BustaModelGameState is converted into structs without pointers to form a packet to send to the server. It makes two sends, a packet identifier message, and the netGameState data packet.
|